package com.ijunfu.spring.lazy._03_lazy_method.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

/**
 *
 * @Title  : 
 * @Author : ijunfu <ijunfu@163.com>
 * @Date   : 2023/11/6 16:55
 * @Version: 1.0
 * @Motto  : 世界很大 世界很小
 *
 */
@Service
public class UserService {

    private RoleService roleService;

    @Lazy
    @Autowired
    public void setRoleService(RoleService roleService) {
        this.roleService = roleService;
    }

    public void printRole(){
        System.out.println(roleService);
    }
}
